Add write-only support for Franson Software's GPS Simulator format.
authorrobertl <robertl>
Fri, 19 May 2006 23:03:09 +0000 (23:03 +0000)
committerrobertl <robertl>
Fri, 19 May 2006 23:03:09 +0000 (23:03 +0000)
Makefile.in
defs.h
internal_styles.c
nmea.c
reference/track/tracks.gpssim [new file with mode: 0644]
reference/waypoints.gpssim [new file with mode: 0644]
testo
vecs.c
xmldoc/formats/gpssim.xml [new file with mode: 0644]
xmldoc/formats/options/gpssim-split.xml [new file with mode: 0644]
xmldoc/formats/options/gpssim-wayptspd.xml [new file with mode: 0644]

index 2f5287cda631ae653f9e2bc48a60d83d5e4364dc..c306f91dfafe0be3250f23b143dc62330317d8cd 100644 (file)
@@ -44,7 +44,7 @@ FMTS=magproto.o gpx.o geo.o mapsend.o mapsource.o garmin_tables.o \
        vcf.o overlay.o kml.o google.o lowranceusr.o an1.o tomtom.o \
        tef_xml.o maggeo.o pathaway.o vitosmt.o gdb.o bcr.o coto.o \
        ignrando.o stmwpp.o msroute.o cst.o nmn4.o mag_pdb.o compegps.o \
-       yahoo.o unicsv.o wfff_xml.o garmin_txt.o axim_gpb.o
+       yahoo.o unicsv.o wfff_xml.o garmin_txt.o axim_gpb.o gpssim.o
 
 FILTERS=position.o duplicate.o arcdist.o polygon.o smplrout.o \
        reverse_route.o sort.o stackfilter.o trackfilter.o discard.o \
diff --git a/defs.h b/defs.h
index 4ebcb4fb1a4fe4bf6f5c08835b015d968e8d99b4..f28206e2d0589b274a40c7c7b43693baf67e3baa 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -764,6 +764,11 @@ double fmt_speed(const double, char **tag);
  */
 void gb_sleep(unsigned long microseconds);
 
+/*
+ * From nmea.c
+ */
+int nmea_cksum(const char *const buf);
+
 /*
  * Color helpers.
  */
index 69dc534b0957ae4267b79fd80a79374c8d247f9f..807024c5717d41416e46eacbe7eb10133fb68e0c 100644 (file)
@@ -853,40 +853,6 @@ static char tabsep[] =
 "IFIELD  GEOCACHE_PLACER,\"\",\"%s\"\n"
 "IFIELD  YYYYMMDD_TIME,\"\",\"%ld\"\n"
 ;
-static char xmap[] = 
-"# gpsbabel XCSV style file\n"
-"#\n"
-"# Format: DeLorme Xmap Conduit\n"
-"# Author: Alex Mottram\n"
-"#   Date: 12/09/2002\n"
-"#\n"
-"# \n"
-"# As defined in csv.c/xmap\n"
-"#\n"
-
-"DESCRIPTION           DeLorme XMap HH Native .WPT\n"
-"EXTENSION             wpt\n"
-
-"#\n"
-"# FILE LAYOUT DEFINITIIONS:\n"
-"#\n"
-"FIELD_DELIMITER               COMMASPACE\n"
-"RECORD_DELIMITER      NEWLINE\n"
-"BADCHARS              COMMA\n"
-
-"PROLOGUE      BEGIN SYMBOL\n"
-"EPILOGUE      END\n"
-"#\n"
-"# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-"#\n"
-"IFIELD        LAT_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-"IFIELD        LON_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-"IFIELD        DESCRIPTION, \"\", \"%s\"\n"
-
-"OFIELD        LAT_DECIMAL, \"\", \"%08.5f\"\n"
-"OFIELD        LON_DECIMAL, \"\", \"%08.5f\"\n"
-"OFIELD        DESCRIPTION, \"\", \"%s\"\n"
-;
 static char xmap2006[] = 
 "# gpsbabel XCSV style file\n"
 "#\n"
@@ -925,6 +891,40 @@ static char xmap2006[] =
 
 
 
+;
+static char xmap[] = 
+"# gpsbabel XCSV style file\n"
+"#\n"
+"# Format: DeLorme Xmap Conduit\n"
+"# Author: Alex Mottram\n"
+"#   Date: 12/09/2002\n"
+"#\n"
+"# \n"
+"# As defined in csv.c/xmap\n"
+"#\n"
+
+"DESCRIPTION           DeLorme XMap HH Native .WPT\n"
+"EXTENSION             wpt\n"
+
+"#\n"
+"# FILE LAYOUT DEFINITIIONS:\n"
+"#\n"
+"FIELD_DELIMITER               COMMASPACE\n"
+"RECORD_DELIMITER      NEWLINE\n"
+"BADCHARS              COMMA\n"
+
+"PROLOGUE      BEGIN SYMBOL\n"
+"EPILOGUE      END\n"
+"#\n"
+"# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
+"#\n"
+"IFIELD        LAT_HUMAN_READABLE, \"\", \"%08.5f\"\n"
+"IFIELD        LON_HUMAN_READABLE, \"\", \"%08.5f\"\n"
+"IFIELD        DESCRIPTION, \"\", \"%s\"\n"
+
+"OFIELD        LAT_DECIMAL, \"\", \"%08.5f\"\n"
+"OFIELD        LON_DECIMAL, \"\", \"%08.5f\"\n"
+"OFIELD        DESCRIPTION, \"\", \"%s\"\n"
 ;
 static char xmapwpt[] = 
 "# gpsbabel XCSV style file\n"
@@ -958,7 +958,7 @@ static char xmapwpt[] =
 "IFIELD        IGNORE, \"\", \"%-.31s\"\n"
 "IFIELD        DESCRIPTION, \"\", \"%-.78s\"\n"
 ;
-style_vecs_t style_list[] = {{ "xmapwpt", xmapwpt } , { "xmap2006", xmap2006 } , { "xmap", xmap } , { "tabsep", tabsep } , { "saplus", saplus } , { "s_and_t", s_and_t } , { "openoffice", openoffice } , { "nima", nima } , { "mxf", mxf } , { "mapconverter", mapconverter } , { "kwf2", kwf2 } , { "ktf2", ktf2 } , { "gpsman", gpsman } , { "gpsdrivetrack", gpsdrivetrack } , { "gpsdrive", gpsdrive } , { "geonet", geonet } , { "garmin_poi", garmin_poi } , { "garmin301", garmin301 } , { "fugawi", fugawi } , { "dna", dna } , { "custom", custom } , { "cup", cup } , { "csv", csv } , { "cambridge", cambridge } , { "arc", arc } ,  {0,0}};
+style_vecs_t style_list[] = {{ "xmapwpt", xmapwpt } , { "xmap", xmap } , { "xmap2006", xmap2006 } , { "tabsep", tabsep } , { "saplus", saplus } , { "s_and_t", s_and_t } , { "openoffice", openoffice } , { "nima", nima } , { "mxf", mxf } , { "mapconverter", mapconverter } , { "kwf2", kwf2 } , { "ktf2", ktf2 } , { "gpsman", gpsman } , { "gpsdrivetrack", gpsdrivetrack } , { "gpsdrive", gpsdrive } , { "geonet", geonet } , { "garmin_poi", garmin_poi } , { "garmin301", garmin301 } , { "fugawi", fugawi } , { "dna", dna } , { "custom", custom } , { "cup", cup } , { "csv", csv } , { "cambridge", cambridge } , { "arc", arc } ,  {0,0}};
 size_t nstyles = 25;
 #else /* CSVFMTS_ENABLED */
 style_vecs_t style_list[] = {{0,0}};
diff --git a/nmea.c b/nmea.c
index af12da46a6c3bce133614500bc0d287ff9999154..b8cab9e5a304dded3de89866c312916ad575dcef 100644 (file)
--- a/nmea.c
+++ b/nmea.c
@@ -182,7 +182,7 @@ arglist_t nmea_args[] = {
 /*
  * Slightly different than the Magellan checksum fn.
  */
-static int
+int
 nmea_cksum(const char *const buf)
 {
        int x = 0 ;
diff --git a/reference/track/tracks.gpssim b/reference/track/tracks.gpssim
new file mode 100644 (file)
index 0000000..1c8d2a8
--- /dev/null
@@ -0,0 +1,128 @@
+$FRSPD,0.04*65\r
+$FRWPT,3003.73100,N,09136.62100,W,1.0,250502,170621*63\r
+$FRSPD,1.24*66\r
+$FRWPT,3003.76700,N,09136.63400,W,0.0,250502,170955*69\r
+$FRSPD,6.70*60\r
+$FRWPT,3003.76200,N,09136.49600,W,0.0,250502,171200*6C\r
+$FRSPD,7.43*61\r
+$FRWPT,3003.74000,N,09136.44300,W,0.0,250502,171248*68\r
+$FRSPD,7.39*6C\r
+$FRWPT,3003.69200,N,09136.31700,W,0.0,250502,171441*6F\r
+$FRSPD,14.61*53\r
+$FRWPT,3003.58700,N,09135.96400,W,0.0,250502,171716*64\r
+$FRSPD,43.13*54\r
+$FRWPT,3003.46800,N,09135.80100,W,0.0,250502,171746*63\r
+$FRSPD,35.48*5B\r
+$FRWPT,3003.32300,N,09135.69400,W,0.0,250502,171820*66\r
+$FRSPD,25.45*57\r
+$FRWPT,3003.23300,N,09135.55700,W,0.0,250502,171901*68\r
+$FRSPD,19.37*5D\r
+$FRWPT,3002.98400,N,09135.38500,W,0.0,250502,172046*6E\r
+$FRSPD,12.72*57\r
+$FRWPT,3002.94100,N,09135.39300,W,0.0,250502,172110*62\r
+$FRSPD,27.18*5D\r
+$FRWPT,3002.92800,N,09135.57600,W,0.0,250502,172151*65\r
+$FRSPD,38.06*5C\r
+$FRWPT,3002.77400,N,09135.78700,W,0.0,250502,172235*6F\r
+$FRSPD,26.63*50\r
+$FRWPT,3002.73100,N,09135.92300,W,0.0,250502,172308*61\r
+$FRSPD,0.38*6A\r
+$FRWPT,3002.83800,N,09136.01600,W,0.0,250502,180423*68\r
+$FRSPD,2.60*65\r
+$FRWPT,3002.82000,N,09135.97800,W,2.0,250502,180604*66\r
+$FRSPD,3.97*6C\r
+$FRWPT,3002.78600,N,09135.96800,W,0.0,250502,180706*65\r
+$FRSPD,2.95*6F\r
+$FRWPT,3002.77200,N,09135.93700,W,1.0,250502,180818*65\r
+$FRSPD,3.68*6C\r
+$FRWPT,3002.78200,N,09135.86400,W,0.0,250502,181020*6E\r
+$FRSPD,4.21*66\r
+$FRWPT,3002.78100,N,09135.83000,W,0.0,250502,181109*66\r
+$FRSPD,5.13*66\r
+$FRWPT,3002.80700,N,09135.78000,W,0.0,250502,181218*60\r
+$FRSPD,4.02*67\r
+$FRWPT,3002.84700,N,09135.71200,W,0.0,250502,181422*60\r
+$FRSPD,5.14*61\r
+$FRWPT,3002.86800,N,09135.68600,W,2.0,250502,181504*66\r
+$FRSPD,4.47*66\r
+$FRWPT,3002.89500,N,09135.64500,W,1.0,250502,181614*6A\r
+$FRSPD,4.46*67\r
+$FRWPT,3002.92100,N,09135.62800,W,1.0,250502,181701*6A\r
+$FRSPD,4.26*61\r
+$FRWPT,3002.96100,N,09135.63100,W,0.0,250502,181807*6E\r
+$FRSPD,3.94*6F\r
+$FRWPT,3003.01900,N,09135.63900,W,2.0,250502,181951*61\r
+$FRSPD,4.21*66\r
+$FRWPT,3003.04700,N,09135.64700,W,0.0,250502,182039*65\r
+$FRSPD,4.67*64\r
+$FRWPT,3003.07400,N,09135.66200,W,0.0,250502,182124*6F\r
+$FRSPD,4.50*60\r
+$FRWPT,3003.10800,N,09135.66200,W,0.0,250502,182217*66\r
+$FRSPD,3.39*68\r
+$FRWPT,3003.13300,N,09135.68000,W,0.0,250502,182318*6C\r
+$FRSPD,4.26*61\r
+$FRWPT,3003.18100,N,09135.68100,W,0.0,250502,182437*6E\r
+$FRSPD,3.71*64\r
+$FRWPT,3003.29200,N,09135.71200,W,6.0,250502,182813*68\r
+$FRSPD,2.40*67\r
+$FRWPT,3003.22400,N,09135.69600,W,2.0,250502,183136*63\r
+$FRSPD,2.97*6D\r
+$FRWPT,3003.19100,N,09135.68700,W,0.0,250502,183256*69\r
+$FRSPD,3.52*65\r
+$FRWPT,3003.15800,N,09135.69000,W,0.0,250502,183402*6D\r
+$FRSPD,1.91*68\r
+$FRWPT,3003.14700,N,09135.72600,W,0.0,250502,183603*6C\r
+$FRSPD,4.33*65\r
+$FRWPT,3003.14900,N,09135.75800,W,0.0,250502,183648*64\r
+$FRSPD,4.77*65\r
+$FRWPT,3003.15900,N,09135.80700,W,1.0,250502,183752*6B\r
+$FRSPD,5.10*65\r
+$FRWPT,3003.18800,N,09135.87100,W,0.0,250502,183918*67\r
+$FRSPD,3.64*60\r
+$FRWPT,3003.21700,N,09135.87800,W,0.0,250502,184015*68\r
+$FRSPD,2.35*65\r
+$FRWPT,3003.23800,N,09135.86600,W,6.0,250502,184125*6E\r
+$FRSPD,2.60*65\r
+$FRWPT,3003.21700,N,09135.88500,W,0.0,250502,184237*68\r
+$FRSPD,2.21*60\r
+$FRWPT,3003.19200,N,09135.87500,W,0.0,250502,184401*6A\r
+$FRSPD,1.94*6D\r
+$FRWPT,3003.16900,N,09135.85100,W,0.0,250502,184553*6E\r
+$FRSPD,3.89*63\r
+$FRWPT,3003.15400,N,09135.81600,W,0.0,250502,184654*67\r
+$FRSPD,4.31*67\r
+$FRWPT,3003.14000,N,09135.78600,W,0.0,250502,184742*62\r
+$FRSPD,4.67*64\r
+$FRWPT,3003.13500,N,09135.74100,W,0.0,250502,184841*67\r
+$FRSPD,3.42*64\r
+$FRWPT,3003.13300,N,09135.70100,W,0.0,250502,184952*66\r
+$FRSPD,3.18*6B\r
+$FRWPT,3003.11300,N,09135.68200,W,0.0,250502,185049*6C\r
+$FRSPD,4.32*64\r
+$FRWPT,3003.06300,N,09135.66400,W,0.0,250502,185214*68\r
+$FRSPD,5.05*61\r
+$FRWPT,3003.03400,N,09135.65400,W,0.0,250502,185256*6F\r
+$FRSPD,4.01*64\r
+$FRWPT,3003.01100,N,09135.64600,W,0.0,250502,185338*62\r
+$FRSPD,5.12*67\r
+$FRWPT,3002.94600,N,09135.62300,W,0.0,250502,185511*66\r
+$FRSPD,4.14*60\r
+$FRWPT,3002.90700,N,09135.65500,W,0.0,250502,185632*60\r
+$FRSPD,4.59*69\r
+$FRWPT,3002.88500,N,09135.68500,W,0.0,250502,185724*60\r
+$FRSPD,4.66*65\r
+$FRWPT,3002.85000,N,09135.72700,W,7.0,250502,185840*6B\r
+$FRSPD,5.64*66\r
+$FRWPT,3002.82400,N,09135.76000,W,0.0,250502,185928*63\r
+$FRSPD,5.27*61\r
+$FRWPT,3002.79800,N,09135.79600,W,0.0,250502,190022*65\r
+$FRSPD,5.00*64\r
+$FRWPT,3002.78400,N,09135.85900,W,0.0,250502,190141*60\r
+$FRSPD,4.56*66\r
+$FRWPT,3002.77400,N,09135.90800,W,0.0,250502,190248*60\r
+$FRSPD,3.37*66\r
+$FRWPT,3002.77900,N,09135.93800,W,0.0,250502,190343*64\r
+$FRSPD,3.45*63\r
+$FRWPT,3002.80700,N,09135.95700,W,0.0,250502,190449*66\r
+$FRSPD,2.98*62\r
+$FRWPT,3002.82800,N,09135.98000,W,0.0,250502,190557*6F\r
diff --git a/reference/waypoints.gpssim b/reference/waypoints.gpssim
new file mode 100644 (file)
index 0000000..9d7800a
--- /dev/null
@@ -0,0 +1,9 @@
+$FRWPT,3558.32200,N,08708.08200,W,0.0*69\r
+$FRWPT,3605.44100,N,08640.77300,W,0.0*64\r
+$FRWPT,3559.77600,N,08637.20700,W,0.0*6F\r
+$FRWPT,3602.30900,N,08638.91700,W,0.0*6B\r
+$FRWPT,3606.73100,N,08644.50600,W,0.0*67\r
+$FRWPT,3603.84500,N,08647.43100,W,0.0*68\r
+$FRWPT,3605.26600,N,08648.58400,W,0.0*65\r
+$FRWPT,3603.45000,N,08653.52000,W,0.0*64\r
+$FRWPT,3604.96800,N,08652.03700,W,0.0*67\r
diff --git a/testo b/testo
index 1f4601772493ccb9737e7d632a727945e245239c..7020e0005b53a39eb1dfd9106d22c01fd83edda4 100755 (executable)
--- a/testo
+++ b/testo
@@ -1063,4 +1063,13 @@ rm -f ${TMPDIR}/axim-*
 ${PNAME} -i axim_gpb -f ${REFERENCE}/track/axim-sample.gpb -o gpx -F ${TMPDIR}/axim-sample.gpx
 compare ${REFERENCE}/track/axim-sample.gpx ${TMPDIR}/axim-sample.gpx
 
+#
+# Franson GPSGate simulation
+#
+${PNAME} -i geo -f ${REFERENCE}/../geocaching.loc -o gpssim -F ${TMPDIR}/waypoints.gpssim
+compare ${TMPDIR}/waypoints.gpssim ${REFERENCE}
+${PNAME} -i gpx -f ${REFERENCE}/track/tracks.gpx -o gpssim -F ${TMPDIR}/tracks.gpssim
+compare ${TMPDIR}/tracks.gpssim ${REFERENCE}/track
+
+
 exit 0
diff --git a/vecs.c b/vecs.c
index 72a5fecacbeb1b147b254c18bd56c429c2676326..02c4bb0ef0c1b6bed441aa7f129644ae3fccd18c 100644 (file)
--- a/vecs.c
+++ b/vecs.c
@@ -55,6 +55,7 @@ extern ff_vecs_t glogbook_vecs;
 extern ff_vecs_t google_vecs;
 extern ff_vecs_t gpilots_vecs;
 extern ff_vecs_t gpl_vecs;
+extern ff_vecs_t gpssim_vecs;
 extern ff_vecs_t gpspilot_vecs;
 extern ff_vecs_t gpsutil_vecs;
 extern ff_vecs_t gpx_vecs;
@@ -551,6 +552,12 @@ vecs_t vec_list[] = {
                "GPS TrackMaker",
                "gtm"
        },
+       {
+               &gpssim_vecs,
+               "gpssim",
+               "Franson GPSGate Simulation",
+               "gpssim"
+       },
 #if CSVFMTS_ENABLED
         {
                &garmin_txt_vecs,
diff --git a/xmldoc/formats/gpssim.xml b/xmldoc/formats/gpssim.xml
new file mode 100644 (file)
index 0000000..c318310
--- /dev/null
@@ -0,0 +1,9 @@
+  <para>
+        This is a write-only format used to feed waypoints, tracks, and routes
+        into <ulink url="http://franson.com/">Franson Technolgies'</ulink>
+        <ulink url="http://franson.com/gpsgate/">GpsGate simulator</ulink>.
+  </para>
+  <para>
+        To use these files in GpsGate, select 'Simulator' and then
+        "File->Open".
+  </para>
diff --git a/xmldoc/formats/options/gpssim-split.xml b/xmldoc/formats/options/gpssim-split.xml
new file mode 100644 (file)
index 0000000..2f20ce5
--- /dev/null
@@ -0,0 +1,17 @@
+<para>When this options is specified, GPSBabel will split 
+        split the output into multiple files using the output filename
+        as a base.  For example, if you specify an output file of 'mytrip',
+<simplelist type="vert">
+  <member>mytrip-waypoints.gpssim - will contain the waypoints.</member>
+  <member>mytrip-track0000.gpssim - will contain the first track.</member>
+  <member>mytrip-track0001.gpssim - will contain the second track.</member>
+  <member>... and so on.</member>
+  <member>mytrip-route0000.gpssim - will contain the first route.</member>
+  <member>mytrip-route0001.gpssim - will contain the seconds route.</member>
+  <member>... and so on.</member>
+</simplelist>
+</para>
+
+<para>
+Valid values for this option are 0 (off) and 1 (on).  The default is '0'.
+</para>
diff --git a/xmldoc/formats/options/gpssim-wayptspd.xml b/xmldoc/formats/options/gpssim-wayptspd.xml
new file mode 100644 (file)
index 0000000..0954b8c
--- /dev/null
@@ -0,0 +1,3 @@
+<para>
+  This options specifies the speed of the simulation in knots.
+</para>